perm filename NOTES.INT[LSP,JRA]3 blob
sn#113576 filedate 1974-07-26 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00003 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 However, this text is %2not%* meant to be a programming manual for LISP.
C00008 00003 These notes are primarily designed for undergraduates and therefore
C00012 ENDMK
C⊗;
However, this text is %2not%* meant to be a programming manual for LISP.
A certain amount of time is spent giving insights into techniques for
writing LISP functions. There are two reasons for this. First, the style
of LISP programming is quite different from that of "normal" programming.
Second, and more important, we will spend a great deal of time discussing
various levels of implementation of the language. LISP is an excellent
medium for introducing standard techniques such as recursion, garbage collection,
storage allocation, and hashing. It is pointless to attempt to discuss
implementation of a language which is poorly understood.
If the only reasons for learning a programming language were its applications,
then for most standard applications we could do better than LISP. LISP
is at least fifteen years old and many languages now offer themselves with better
notation, more efficient running code, or larger varieties of data structure.
But the more interesting aspects of LISP for students of Computer Science lie
not in its features as a programming language, but in what it can show
about the about the %2structure%* of Computer Science. The application of
computers, as is hardware development, is peripheral to this field. There is a
rapidly expanding body of knowledge unique to Computer Science, neither
mathematical nor engineering per se. Much of this area is presented most
clearly by studying LISP.
As mentioned above, language implementors can learn much from LISP. Indeed,
many of the "standard techniques" in language implementation (e.g. built-in
recursion, garbage collection) originated
with LISP. Many of the more theoretical areas of Computer Science
(e.g. provability, semantics) can be
introduced using LISP. Many of the most interesting applications of computers
(e.g. artifical intelligence, game playing, theorem proving)
have been done using LISP.
Much of the power of LISP lies in its simplicity. It is a"fixed point" in
non-numerical languages. The data structures are rich enough to easily
describe sophisticated algorithms but not so rich as to become obfuscatory.
We will describe translators -- interpreters and compilers -- as very transparent
LISP functions. Indeed the structure of the compilation process becomes so
transparent as to border on the trivial. This is not to say that compiler writing
is trivial or even easy; but the structure of the process is easily seen.
This is partly due to the simplicity of the language, but perhaps more
due to our ability to go right to the compiling process without becoming
bogged down in details of scanners and parsers -- syntax--. Again, syntax
analysis is not trivial, but it is a peripheral activity to our understanding
of compilers and evaluators.
LISP is a better vehicle than its ancestor, the λ-calculus, because there is just enough
more complexity present in LISP to make its implementation a realistic
Computer Science task and not just
an interesting mathematical curiosity. Most every aspect of the implementation
of LISP and its translators has immediate implications to the implementation of
other languages and to the design of programming languages in
general.
LISP has very important implications in the field of programming language
semantics -- the meaning of languages--, also in a field of much current interest,
provability of properties of programs.
***SCOTT***
These notes are primarily designed for undergraduates and therefore
an attempt is made to make them self-contained.
There are basically four areas in which to distribute the topics covered:
the mechanics of the language, the evaluation of expressions in LISP,
the implementation of LISP, and the compilers for LISP. Each area
builds on the previous. Taken as a group these topics introduce
much of what is interesting Computer Science.
There is only viable alternative to LISP if we wish to cover this broad
scope of topics in a unified approach: invent our only language. Other contemporary
languages lack some or all of the necessities.
Toy languages are suspect for several reasons. The student may suspect
(rightly or wrongly) that he is simply a subject in a not too clever
experiment being performed upon him by his instructor.
Having a backlog of fifeen years in
experience and example programs should do much to subdue this discomfort.
The development of LISP also shows many of the mistakes
⊗↓ah, the power of hindsight!←
that the original implementors and designers made.
However with these admonitions in mind we will try our hand at incorporating many
of the lessons learned from LISP and propose a possible
extension of LISP. This extension, described in {yonsec(P87)}
is given not as a panacea
but rather as an example of how a careful study of LISP can aid in the
design of a language.
A large collection of problems has been included. The reader is urged to do as
many as possible. The problems are mostly non-trivial; they attempt to be
realistic, introducing some new information which the readers should be
able to discover themselves.
There are also a few rather substantial projects. At least one should be attempted.
There is a significant difference between being able to program small problems
and handle large projects. The increase in difficulty is exponential
rather than linear.